home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / doc / python-apt / examples / records.py < prev    next >
Encoding:
Python Source  |  2009-03-30  |  298 b   |  14 lines

  1. #!/usr/bin/env python
  2.  
  3. import apt
  4.  
  5. cache = apt.Cache()
  6.  
  7. for pkg in cache:
  8.     if not pkg.candidateRecord:
  9.         continue
  10.     if "Task" in pkg.candidateRecord:
  11.         print "Pkg %s is part of '%s'" % (
  12.             pkg.name, pkg.candidateRecord["Task"].split())
  13.         #print pkg.candidateRecord
  14.